Week Twelve
Click the Arrow to Proceed to Project Page
Click the Arrow to Proceed to Project Page
Flipping between day and night
This week, Alexis and I endeavored to make the basic process of controlling an LED with a button a bit more exciting: we decided to use a button to switch between day and night (on our screens at least).
We selected Processing as our tool as it connects really well the with the Arduino IDE. We based our process off of the tutorial found here. We took our fabduino boards from last week (evidence that they worked!) and connected them to a breadboard that held a button.
As explained in the tutorial, we started in the Arduino IDE, ensuring that we could even read in useful data from the button. We had some issues estabilishing a connection with the serial port (my computer kept thinking that the port was busy, even though it wasn't), but ultimately we were able to read whether the button was pushed (button!) or not (No button!) as shown here:
We then followed the tutorial to pull this information into processing to create graphics:
Eventually we realized that the Arduino IDE was sending too much information to Processing, and instead decided to set up a boolean so that information would only be sent when the state of the button changed. It took a while to get this to work (we got some NullPointer Errors in between), but ultimately doing this worked when we added a large delay - now the user has control of the image on the screen based on use of the button. We had to make sure the pins correlated with those in the Fabduino, and we used the HE_Mesh Processing library to create a geodesic shape that changed colors based on whether the button was pressed or not. We decided to switch between a landscape mimicking the moon and one mimicking the sun, so we played around with the RGB values and shading values in Processing until we achieved the desired effect.
When the button is pressed:
When the button is off:
Next Steps
Thanks to Alexis, Juliana C, Juliana N, and Ermal for their help, support, and advice :).